package cn.wolfcode.service;

import cn.wolfcode.domain.Question;
import cn.wolfcode.domain.QuestionItem;
import cn.wolfcode.qo.NewExam;
import cn.wolfcode.qo.QueryObject;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;

public interface IQuestionService {
    void save(Question question);
    void delete(Long id);
    void update(Question question);
    Question get(Long id);
    List<Question> listAll();
    // 分页查询的方法
    PageInfo<Question> query(QueryObject qo);

    List<QuestionItem> selectItemsByQuestionId(Long id);

    List<String> selectOptionsByQuestionId(Long id);

    //找各类型题目封装到map中
    List<HashMap> selectSingleQuestions(Long examId, Long type);
    List<HashMap> selectMultipleQuestions(Long examId, Long type);
    List<HashMap> selectJudgeQuestions(Long examId, Long type);

    //随机产生指定数量的题目,并将数据加到中间表中
    void addQuestions(NewExam newExam);
}
